by Calvin Chinn
efscopy is one of the unsupported copy utilities in the SiliconáGraphics IRIX environment. However, efscopy has several characteristics that distinguish it from other such utilities. This article describes the features that underscore the usefulness of this utility.
efscopy
You can treat this file as you would any other UNIX file. To restore your disk drive to its original contents, use efscopy to copy from the file back to the disk.
Here are some practical applications of the efscopy utility:
The syntax of efscopy is as follows:
efscopy [-v] fromdev|fromfile todev [todev ...]
orefscopy [-v] fromdev|fromfile tofile
You can also undo the operation by reversing the arguments.
The only option to efscopy is -v, which enables verbose mode. This option is useful because it provides a running status to the completion of the copy.
Before using this utility, be sure to read the following:
Approximately the value of the use column in df -k of the option disk plus another 3ápercent more bytes are required to hold the option disk's contents onto an efscopy file. In this example, we are placing this file onto the / directory. The destination is determined by whether there is sufficient disk space to hold the efscopy file.
To copy the contents of an option disk (including a system disk) to a file:
efscopy -v /dev/rdsk/{devicename} {filename}
{devicename}
is in the form of /dev/rdsk/dksAdBsC
where:
A is the option drive SCSI controller number
B is the option drive SCSI unit number
C is the option drive partition number of the entire disk
For example:
efscopy -v /dev/rdsk/dks0d2s7 optiondisk.efs
Note the use of the raw device (also called character device) name with rdsk.
After typing the command in stepá3, your workstation displays the following text:
reading 9999 nodes..10%..20%...90%..done
writing 99999 nodes..10%..20%...90%..done
lastalloc/maximum=99999
block delta -1
You have copied the entire contents of the option disk onto a single file. Preserve it like any other UNIX file; use it to restore any option disk drive to these same bits.
To reverse the process by copying from a file to a device:
Note: Ensure that the efscopy file is not larger (in bytes) than the disk drive that you are restoring.
mkfs {target-device-name}
mkfs -r {target-device-name}
The two mkfs are needed because efscopy enforces strict requirements for usage. efscopy takes lost+found directory into account. The filesystem must be using 2áinodes (inode 2 for . and 3 for lost+found) and 21áblocks (1 for the . directory block and 20 for the lost+found directory block).
efscopy -v filename /dev/rdsk/{target-device-name}
For example:
efscopy -v /optiondisk.efs /dev/rdsk/dks0d2s7
After typing the command in stepá5, your workstation displays the following text:
reading 9999 nodes..10%..20%...90%..done
writing 99999 nodes..10%..20%...90%..done
lastalloc/maximum=99999
block delta -1
If you attempt to mount this filesystem, you will get a "dirty filesystem" message.
fsck {target-device-name}
or
mount -c
to invoke fsck
or
reboot to invoke fsck
efscopy is an internal utility that Silicon Graphics wrote to facilitate its manufacturing operations. Silicon Graphics uses it in the production process to duplicate identical system disks for the workstation product line. The company also uses efscopy to copy data from a file to multiple devices in one command invocation. In addition to these applications, you can NFS mount a previously created efscopy file and copy it to a local target device.
You can obtain efscopy on Versioná5.1 of the Developer Toolbox CD. If you are an active member of the Silicon Graphics Developer Program, you should have already received this CD in your mail. Included with the efscopy executable script are equivalent file format copies in ASCII text (README) and hypertext Web form (index.html), which describe the same steps as discussed in this article. If you have any questions about efscopy, send an e-mail to devsupport@sgi.com.
You can also find efscopy at the following location on the Web version of the Developer Toolbox:
This Web site requires a user ID and password, which are distributed only to members of the Developer Program. To find out how you can access this Web site, send an e-mail to devprogram@sgi.com.
We welcome feedback and comments at
devprogram@sgi.com.